<?php use_helper('PA_Links') ?>
<table id="projectsTable">
  <th>Lp.</th>
  <th>Nazwa</th>
  <th>Inwestor</th>
  <th>Adres</th>
  <th>Skrót</th>
  <th>Edycja</th>
  <?php if(isset($projects)): ?>
  <?php foreach($projects as $project): ?>
  <tr>
    <td><p id="counter"></p></td>
    <td><?php echo $project->getName() ?></td>
    <td><?php echo $project->getInvestor() ?></td>
    <td><?php echo $project->getAddress() ?></td>
    <td><?php echo $project->getShortcut() ?></td>
    <td nowrap="nowrap">
      <img src="/images/icons/change.png" class="middle" width="18" height="18"/>  <a onclick="App.Table.attachForm(this, '<?php echo link_to_app('Core', 'homeGetForm', array('form' => 'ProjectForm', 'form_action' => 'update', 'id' => $project->getId())) ?>', '#projectsTable', 'updateProject', 5, 4, true)" class="middle">Zmień</a>
      <img src="/images/icons/delete.png" class="middle" width="18" height="18"/>  <a onclick="return confirm('Jesteś pewien?')" href="<?php echo link_to_app('Production', 'deleteProject', array('id' => $project->getId())) ?>" class="middle">Usuń</a>
    </td>
  </tr>
  <?php endforeach; ?>
  <?php endif; ?>
  <tr id="add">
    <td colspan="6"><img src="/images/icons/add.png" class="middle" width="18" height="18"/>  <a onclick="App.Table.attachForm(this, '<?php echo link_to_app('Core', 'homeGetForm', array('form' => 'ProjectForm', 'form_action' => 'create')) ?>', '#projectsTable', 'createProject', 4, 4)" class="middle">Dodaj</a></td>
  </tr>
</table>